Telegram Group & Telegram Channel
​​DeepGit: Hashing and Cating. Понимаем файловую систему.

Ч1

Как я говорил ранее, Git это файловая система основой которой являются файлы типа tree, commit, blob.
Подробнее о типах файлов у меня вышла статья на DevQuiz.
Рекомендую прочесть ее и вернуться сюда.

Для того чтобы git начал мониторить ваши файлы ему нужно получить blob файл с этим данными.
Если вы после создания репозитория посмотрите в папку objects она будет пуста, даже если в директории с гитом уже есть файлы.

Чтобы добавить файл в git есть техническая команда git hash-object -w filename.txt она делает blob файл с вашими данными и сохраняет себе в objects.

После этого git status все еще будет пуст, так как индекса еще нет, но git уже сохранил себе версию этого файла.
Именно эта команда лежит в основе гита, это такой себе "save" ваших данных.

Например вы сделали
 echo "first version" >  new_file.txt
git hash-object -w new_file.txt

У вас появляется файл new_file.txt с текстом first version и появляется файл de8d69c9026be2a49f540fda12f3e755a33e6c в папке 22 с таким же текстом.

Следом мы делаем
 echo "second version" > new_file.txt
git hash-object -w new_file.txt

У нас появляется доп файл 7ac37bb280ccd34b350a59ba440614d9106e41 в папке ad с текстом second version

Теперь с помощью git cat-file -p 22de8d69c9026be2a49f540fda12f3e755a33e6c > new_file.txt можно переключиться на старую версию.

И все это происходит до того как вы сделали git add.
Все еще с пустым индексом.



tg-me.com/developer_tools/238
Create:
Last Update:

​​DeepGit: Hashing and Cating. Понимаем файловую систему.

Ч1

Как я говорил ранее, Git это файловая система основой которой являются файлы типа tree, commit, blob.
Подробнее о типах файлов у меня вышла статья на DevQuiz.
Рекомендую прочесть ее и вернуться сюда.

Для того чтобы git начал мониторить ваши файлы ему нужно получить blob файл с этим данными.
Если вы после создания репозитория посмотрите в папку objects она будет пуста, даже если в директории с гитом уже есть файлы.

Чтобы добавить файл в git есть техническая команда git hash-object -w filename.txt она делает blob файл с вашими данными и сохраняет себе в objects.

После этого git status все еще будет пуст, так как индекса еще нет, но git уже сохранил себе версию этого файла.
Именно эта команда лежит в основе гита, это такой себе "save" ваших данных.

Например вы сделали

 echo "first version" >  new_file.txt
git hash-object -w new_file.txt

У вас появляется файл new_file.txt с текстом first version и появляется файл de8d69c9026be2a49f540fda12f3e755a33e6c в папке 22 с таким же текстом.

Следом мы делаем
 echo "second version" > new_file.txt
git hash-object -w new_file.txt

У нас появляется доп файл 7ac37bb280ccd34b350a59ba440614d9106e41 в папке ad с текстом second version

Теперь с помощью git cat-file -p 22de8d69c9026be2a49f540fda12f3e755a33e6c > new_file.txt можно переключиться на старую версию.

И все это происходит до того как вы сделали git add.
Все еще с пустым индексом.

BY Dev Tools


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/developer_tools/238

View MORE
Open in Telegram


Dev Tools Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

Telegram auto-delete message, expiring invites, and more

elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.

Dev Tools from vn


Telegram Dev Tools
FROM USA